package com.moonciki.multids.properties;

import com.moonciki.multids.constant.MultiDsConstant;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;

@Data
@Component
@ConfigurationProperties(prefix = MultiDsConstant.PREFIX)
public class MultiDataSourceProperty {

    @NotNull(message = "mapperBasePackage must not be null !!")
    private String mapperBasePackage;

    /** 数据源前缀 **/
    private String namePrefix = MultiDsConstant.DS_NAME_PREFIX;

    private Map<String, DataSourceProperty> datasources;

}
